<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
	"http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<!-- Processed by MultiMarkdown -->
		<meta name="Format" content="complete" />
	</head>
<body>

<h1 id="pternaryversion0.2">Pternary version 0.2</h1>

<h2 id="introduction">Introduction</h2>

<p>Pternary draws points, lines, and polygons on a triangular (ternary) graph.  Negative values are allowed. It has a graphical user interface written in Tkinter.</p>

<h2 id="requirements">Requirements</h2>

<p>Python 2.3 and Tkinter are the only libraries used, so it should run on any system that has an implementation of those. It is written and tested on the standard installation of Mac OS X 10.4.11. I also test it on Mac OS X 10.5.2. I&#8217;d be interested to hear if you can run it on Windows.</p>

<p>No installation is required. Place the pternary directory wherever you wish, and then run <code>pternary.py</code> as usual.</p>

<p>If you&#8217;re not familiar with Python here are some instructions (if you are running Mac OS X). Download [pternary-0.2.zip] to your Desktop. Double-click on it to unzip. Then open the Terminal application, and type the following commands (do not include the <code>$</code>)</p>

<pre><code>$ cp -r ~/Desktop/pternary-0.2/* ~/
$ rm -r ~/Desktop/pternary-0.2*</code></pre>

<p>Then to run it:</p>

<pre><code>$ cd ~/pternary
$ python pternary.py</code></pre>

<p>The first command changes your directory, the second runs the program. You will have to minimize the Terminal to see Pyternary running behind it.</p>

<h2 id="howtouse">How to use</h2>

<p>Enter points in the form of three numbers summing to 1 (although the program currently doesn&#8217;t verify this) in the text field and click &#8216;Add&#8217; to send them to the plotting buffer, which is the upper box on the right.</p>

<p>Enter a name for the point/lin/polygon in the field directly below the &#8216;Plot&#8217; button. The buffer is plotted to the graph with this button; if there is only one point in the buffer, a point will be plotted; two points make a line; three a triangle; four a quadrilateral; and so on. </p>

<p>The &#8216;Cancel&#8217; button removes the selected point from the plotting buffer. </p>

<p>Each time the plot button is clicked a plotting object (not in the Python sense) is created with the name which was entered. These can be deleted from the plot with the &#8216;Remove&#8217; button. They can&#8217;t be edited. They can be highlighted (one only at a time) with the &#8216;Highlight&#8217; button.</p>

<p>The scale bar on the left allows you to zoom out. The &#8216;Reset&#8217; button removes all objects.</p>

<h3 id="configuration">Configuration</h3>

<p>A configuration file <code>config.sys</code> is included with the download; it must be in the same folder as <code>ternary.py</code> or you will get a lot of errors! Lines beginning with a <code>#</code> symbols are comments. Here is a description of the various options:</p>

<pre><code># Log file
log : True</code></pre>

<p>Whether to produce a log file; this function is a little haphazard so far, but will produce (quite lengthy) files. Anything other than <code>True</code> is interpreted as &#8216;no&#8217;.</p>

<pre><code>log-file : pternary.log</code></pre>

<p>Feel free to change; it will be made in the same directory as <code>pternary.py</code>.</p>

<pre><code># Drawing canvas
canvas-width : 600
canvas-height : 533</code></pre>

<p>The program might not work very well if these are changed too much.</p>

<pre><code>fill-colour : red</code></pre>

<p>This sets the fill colour for the &#8216;Highlight&#8217; function.</p>

<pre><code>scale-change-delta : 40</code></pre>

<p>The lower this number, the more entries in the log file, basically.</p>

<pre><code># Plotting
point-radius : 3</code></pre>

<p>The radius, in pixels, of the small circles that are used to plot points. Future versions will have different shapes available.</p>

<pre><code>empty-buffer-after-plot : False</code></pre>

<p>Up to you &#8211; if you are drawing points at the vertexes of polygons you will probably find it useful set to <code>False</code>; if you are just drawing points, <code>True</code> will probably suit better.</p>

<pre><code># Scale bar
initial-scale : 500
scale-min : 200
scale-max : 550</code></pre>

<p>A bit cryptic for the time being, these may change in the future.</p>

<h2 id="changes">Changes</h2>

<h3 id="version0.2">Version 0.2</h3>

<ul>
<li>Major code re-write (cast in classes)</li>
<li>Can resize plot without losing objects</li>
<li>All plot objects have names</li>
</ul>

<h3 id="version0.1">Version 0.1</h3>

<ul>
<li>Built basic interface</li>
<li>Ability to plot points, lines, and polygons</li>
<li>Resize graph</li>
<li>Reset axes</li>
<li>Highlight items</li>
</ul>

<h3 id="plannedfeatures">Planned features</h3>

<ul>
<li>Axis labels</li>
<li>Edit plot objects</li>
<li>Import from text file</li>
</ul>

<h2 id="screenshots">Screenshots</h2>

<p><img id="pternary-0.2" src="pternary-0.2.png" alt="pternary-0.2" title="pternary-0.2" /></p>
</body>
</html>